package com.wuxianedu.a242_animation;

import android.graphics.drawable.AnimationDrawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ImageView iv = (ImageView) findViewById(R.id.frame_iv);
        iv.setBackgroundResource(R.drawable.frameanimation);
        AnimationDrawable frame = (AnimationDrawable) iv.getBackground();
        frame.start();
    }
}
